\name{read.ini}
\alias{read.ini}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
%%  ~~function to do ... ~~
}
\description{
%%  ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
read.ini(ini.file)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{ini.file}{
%%     ~~Describe \code{ini.file} here~~
}
}
\details{
%%  ~~ If necessary, more details than the description above ~~
}
\value{
%%  ~Describe the value returned
%%  If it is a LIST, use
%%  \item{comp1 }{Description of 'comp1'}
%%  \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%%  ~~who you are~~
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (ini.file) 
{
    a <- readLines(ini.file)
    hpts <- grep("^#", a)
    ini.obj <- list()
    pos <- grep("version number", a, ignore.case = T) + 1
    if (length(pos) == 0) 
        ini.obj$version = 0
    else ini.obj$version <- scanText(a[pos], what = 0)
    pos <- grep("# tag fish rep *$", a, ignore.case = T) + 1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$tag.fish.rep <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# tag fish rep group flags", a, ignore.case = T) + 
        1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$grpflags <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# tag_fish_rep active flags", a, ignore.case = T) + 
        1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$activeflags <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# tag_fish_rep target", a, ignore.case = T) + 
        1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$reptarget <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# tag_fish_rep penalty", a, ignore.case = T) + 
        1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$reppenalty <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# sv\\(29\\)", a) + 1
    if (length(pos) > 0) {
        if (!(pos \%in\% hpts)) {
            ini.obj$sv29 <- scanText(a[pos], what = 0)
            a[pos] <- paste("#", a[pos])
        }
    }
    pos <- grep("# number of age classes", a, ignore.case = T) + 
        1
    ini.obj$nages <- as.numeric(a[pos])
    pos <- grep("# MATURITY AT AGE", a, ignore.case = T) + 1
    ini.obj$mat <- scanText(a[pos], what = 0)
    pos <- grep("# natural mortality", a, ignore.case = T) + 
        1
    ini.obj$M <- scanText(a[pos], what = 0)
    pos <- grep("# move", a, ignore.case = T) + 1
    ini.obj$movemap <- scanText(a[pos], what = 0)
    if (ini.obj$movemap[1] == 0) {
        diffcoffs <- 0
    }
    else {
        pos <- grep("# diffusion coffs", a, ignore.case = T) + 
            1
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$diffcoffs <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# age_pars", a, ignore.case = T) + 1
    if (length(pos) > 0) {
        p2 <- hpts[hpts > pos][1] - 1
        ini.obj$age_pars <- matrix(scanText(a[pos:p2], what = 0), 
            byrow = TRUE, nrow = p2 + 1 - pos)
    }
    pos <- grep("# recruitment", a, ignore.case = T) + 1
    ini.obj$recbyreg <- scanText(a[pos], what = 0)
    b <- scanText(a[(hpts[hpts > pos][1]):length(a)], what = 0, 
        comment.char = "#")
    ini.obj$VBLmin <- b[1:3]
    ini.obj$VBLmax <- b[4:6]
    ini.obj$VBK <- b[7:9]
    ini.obj$LW <- b[10:11]
    ini.obj$sdLatA <- b[12:14]
    ini.obj$Ldep_sd <- b[15:17]
    ini.obj$Nmeanconstr <- b[18:length(b)]
    return(ini.obj)
  }
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
